package cha.app.pong;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.util.DisplayMetrics;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Activator extends Activity implements OnClickListener{
  private final static String TAG = "Activator";
  private Button btn_easy, btn_normal, btn_hard;
  private GameContainer game_screen;
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.main);
   
      btn_easy = (Button)findViewById(R.id.easy_mode);
      btn_normal = (Button)findViewById(R.id.normal_mode);
      btn_hard = (Button)findViewById(R.id.hard_mode);
     
      btn_easy.setOnClickListener(this);
      btn_normal.setOnClickListener(this);
      btn_hard.setOnClickListener(this);
      Log.d(TAG, "Pong Loaded");
    }

    public void onDestroy(){
      super.onDestroy();
    }
    
    @Override
    public void onClick( View v ) {
      Intent game_screen = new Intent(getApplicationContext(), GameContainer.class);
      
      if(v.equals(btn_easy))
        game_screen.putExtra( "difficulty", Utilities.EASY_MODE );
      else if(v.equals(btn_normal))
        game_screen.putExtra( "difficulty", Utilities.NORM_MODE );
      else if(v.equals(btn_hard))
        game_screen.putExtra( "difficulty", Utilities.HARD_MODE );

      startActivity(game_screen);
    }
}